Repository navigation
Conversation
Cherry-pick of 23eefcaed (MicroHs support squashed) with conflicts resolved: Stage->Machine renames applied to Machine.hs, HEAD's dependency bounds and Machine/InMachine logic kept, MicroHs compatibility changes (flag mhs stanzas, c-sources, ifdef __MHS__ guards, fundep IsNode instances, positional GADT constructors) preserved. Verified with GHC 9.14.1 build of lib:Cabal-syntax, lib:Cabal, lib:cabal-install-solver, lib:cabal-install and exe:cabal.
angerman
force-pushed
the
sh/microhs-cabal-install
branch
from
November 12, 2026 00:42
e46621e to
1548a39
Compare
angerman
changed the base branch from
split/pr501x/10b-windows-tmp-retry
to
stable-haskell/merge
November 12, 2026 00:42
angerman
force-pushed
the
sh/microhs-cabal-install
branch
7 times, most recently
from
November 13, 2026 20:17
7b0cd18 to
6f191d4
Compare
- Add bootstrap/mhs/build-cabal-mhs.sh, bootstrap/mhs/microhs-full.patch, and pure-Haskell shim packages (pretty-mhs, uri-mhs, binary-mhs, text-encoding-mhs) under bootstrap/mhs/shims/. - Add bootstrap-mhs job to .github/workflows/bootstrap.yml to build cabal-install (exe:cabal) with MicroHs 0.16.12.0, run smoke tests and ProcessCaptureTests, and upload cabal-ubuntu-latest-mhs-0.16.12.0-bootstrapped via actions/upload-artifact@v7.
angerman
force-pushed
the
sh/microhs-cabal-install
branch
from
November 13, 2026 20:26
6f191d4 to
b04f602
Compare
Validate builds with -Werror. The local stage action discarded a polymorphic put result, so -Wunused-do-bind failed Cabal-3.19 on every GHC validate job and the Alpine static build.
Export the target-name helpers, drop two unused LogProgress imports, and restore the Windows createTempDirectory path. The graft called System.Posix.createDirectory on every non-MHS platform.
LogProgress.hang exists only under __MHS__, because MicroHs pretty has no hang. Import it only there. Compat.Prelude already exports Exception, when, and unless, so the extra imports failed -Werror.
GHC 9.14 rejects FileOrDir(..) under -Werror. The empty compatibility datatype has no constructors, and neither hooks module uses the name.
The test library and custom-setup-tests import Compat.Directory and Compat.Process, not the directory or process packages. GHC 9.6 -Wunused-packages rejects those direct dependencies.
cabal-install-solver and several test suites import Distribution.Compat.Directory, not the directory package. GHC -Wunused-packages rejects the direct dependency. integration-tests2 likewise only uses Compat.Process.
Validate -Werror rejected three cabal-install-solver imports. Machine.hs kept the standard Prelude in scope, so Data.Foldable (Foldable) was unused on GHC. Hide that Prelude, as the other solver modules do, so deriving Foldable still sees the class on GHC and MicroHs. OptionalStanza imported Structured, which Compat.Prelude already exports. nominalStructure stays. PkgConfigDb imported mapM, which Traversable(..) from the prelude already provides.
GHC 9.8.4 with cabal.validate.project (-Werror) failed the cabal-install library, Cabal-tests, cabal-validate, and solver-benchmarks. Compat.Prelude already exports the names those imports repeated. FileOrDir is an empty datatype, so FileOrDir(..) is unused. directory and process are unused where the code only imports Compat.Directory and Compat.Process. The external setup runner now covers InLibraryArgs so -Wincomplete-patterns is satisfied.
getStoreEntries listed the store root, so units under store/lib were never reused. --offline then refused a cached remote package that still looked configured. List the lib directories, and skip reuse when a dependency is still configured instead of asserting. Foreign libraries take their rpath from flibdir. Inplace v2-run also gets rpaths relative to the component build directory. Pin SetupHooks <.> to a Build file path so GHC 9.8+ accepts it, and update the GenericPackageDescription and LocalBuildInfo structure hashes.
Baking the dist build directory into an executable RPATH lets runExe find an internal dynamic library that was never installed (Cabal haskell#4025). v2-run puts those directories on the loader path of the child process instead: DYLD_LIBRARY_PATH on OSX, PATH on Windows, and LD_LIBRARY_PATH elsewhere. An existing loader path is kept. Skip the owner-execute round trip in the directory permissions test on Windows. System.Directory does not report that bit for a file that is not a program.
fourmolu 0.12 aligns the (++) with the (:) in progInvokeEnv.
v2-run executes the binary from its component build directory. The install-relative $ORIGIN rpath to GHC's libHSbase does not resolve from there, and the loader path only listed inplace build directories. CmmSourcesDyn then failed to load libHSbase on Linux. Pre-existing packages contribute libraryDynDirs, or libraryDirs when that list is empty. Non-inplace elaborated packages contribute dynlibdir and libdir. Inplace build directories stay off the executable RPATH.
MicroHs bootstrap failed in ProjectPlanning with "undefined value: InstallDirs" at the data constructor. The last green MicroHs bootstrap imported that constructor. Keeping only the field selectors makes MicroHs reject the qualified record pattern. The pattern uses the constructor directly, so GHC still treats the import as used.
findDependencyInStore stripped vowels on macOS to imitate hashedInstalledPackageIdVeryShort. That id was removed, and macOS store directories use the long id, which starts with the package name. CopyHie, HaddockBuildDepends, and quickjump searched for h-dpndncy, x, and ndf and missed hie-dependency, exe/lib, and indef.
MicroHs bootstrap failed while compiling Main with "undefined value: NixStyleFlags" at the data constructor. CmdHaddockProject updates a NixStyleFlags record, and MicroHs needs that constructor imported. 5ddda20 dropped it as unused for GHC. The pattern names the constructor, so the import stays used.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for compiling the full 4-package closure (
Cabal-syntax,Cabal,cabal-install-solver, andcabal-install/exe:cabal) with MicroHs (mhs0.16.12.0) while keeping the GHC 9.14.1 build and test suite intact, grafted ontostable-haskell/merge(73d3ffda3e, the dual-compiler-aware--with-compiler/--with-build-compilerbranch referenced bystable-haskell/ghc#200).Key Changes
Type-Family-Free &
DataKinds-Free Core:Key aonIsNodeinDistribution.Compat.Graphwith a functional dependencyclass Ord k => IsNode k a | a -> kand parameterizedGraph k a/GenericInstallPlan k ipkg srcpkgacrossCabal-syntax,Cabal,cabal-install-solver, andcabal-install.SymbolicPathX/PathLiketype families inDistribution.Utils.Pathwith phantom-typedSymbolicPath from toand explicitFilePath/Stringpath combinators.RightFlagsForPhase,SetupRunnerRes,InLibraryPhaseRes) and promotedDataKinds(SetupWrapperSpec,ExternalExe) inDistribution.Client.SetupWrapperandDistribution.Client.ProjectBuilding.UnpackedPackagewith GADT-indexedSPostConfigurePhase flags result,InLibraryArgs lbi flags result,SetupRunnerArgs flags result, andWantedExternalExe result.POSIX C11 Shims &
#ifdef __MHS__Compatibility Seams:Cabal-syntax/cbits/mhs_posix.{c,h}: POSIXstat/lstat/utimes/O_CREAT|O_EXCLhelpers forDistribution.Compat.Directory.Cabal/cbits/mhs_spawn.{c,h}:posix_spawnp(3)+waitpid(WNOHANG)process spawning forDistribution.Compat.Process.Cabal/cbits/mhs_handle.{c,h}: MicroHsBFILEUTF-8 transducer detection,fseeko, andflock(2)(mhs_hLock/mhs_hUnlock).cabal-install/cbits/mhs_sha256.{c,h}: One-shot SHA-256 via CommonCrypto (macOS) / OpenSSLlibcrypto(POSIX)..tarreader inDistribution.Client.Compat.Tar+ externaltar/gzipfallback under#ifdef __MHS__.-Pregenerated
Distribution.Fields.Lexer(withoutalex -gunboxedAddr#primops) wired underif impl(mhs).MicroHs Typechecker & Desugarer Workarounds:
Functor/Foldable/Traversable/Eq/Ord/Show/Binary/NFDatainstances under#ifdef __MHS__where MicroHs deriving hits tuple/constructor-scale limits (notablyExtension/KnownExtensionO(N²)deriving Ord).RecordWildCardsbindings inlet/whereblocks (ProjectPlanning.hs) and unqualified field/constructor imports where MicroHsdsUpdateCasedesugars record updates intocasematches.CI Bootstrap Job & Artifact Upload (
.github/workflows/bootstrap.yml+bootstrap/mhs/):bootstrap/mhs/build-cabal-mhs.sh,bootstrap/mhs/microhs-full.patch, and the 4 pure-Haskell shim packages (pretty-mhs,uri-mhs,binary-mhs,text-encoding-mhs) underbootstrap/mhs/shims/.bootstrap-mhsjob in.github/workflows/bootstrap.ymlwhich buildscabal-install(exe:cabal) with MicroHs0.16.12.0, runs the smoke tests andProcessCaptureTests, and uploads thecabalbinary artifact (cabal-ubuntu-latest-mhs-0.16.12.0-bootstrapped) viaactions/upload-artifact@v7.Verification
0.16.12.0:Cabal-syntax,Cabal,cabal-install-solver,cabal-install) compiles and links toexe:cabal(_build/artifacts/cabal, 5.9 MB, 33,784 top-level definitions).cabal --version->cabal-install version 3.19.0.0 (compiled using version 3.19.0.0 of the Cabal library)cabal build --helpexposes both-w / --with-compilerand-W / --with-build-compiler(dual-compiler awareness from73d3ffda3e).(cd Cabal-syntax && cabal check)->No errors or warnings could be found in the package.Cabal/tests/ProcessCaptureTests.hs(backend=mhs):T1–T7all green.9.14.1:cabal build lib:Cabal-syntax lib:Cabal lib:hooks-exe lib:cabal-install-solver lib:cabal-install exe:cabalsucceeds with 0 errors.